package com.yili.oa.dao;

import com.yili.oa.models.PaymentDesc;
import com.yili.oa.models.PaymentDescExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface PaymentDescMapper {
    @SelectProvider(type=PaymentDescSqlProvider.class, method="countByExample")
    long countByExample(PaymentDescExample example);

    @DeleteProvider(type=PaymentDescSqlProvider.class, method="deleteByExample")
    int deleteByExample(PaymentDescExample example);

    @Delete({
        "delete from ft_payment_desc",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into ft_payment_desc (id, payment_desc_content, ",
        "payment_id)",
        "values (#{id,jdbcType=INTEGER}, #{paymentDescContent,jdbcType=VARCHAR}, ",
        "#{paymentId,jdbcType=INTEGER})"
    })
    int insert(PaymentDesc record);

    @InsertProvider(type=PaymentDescSqlProvider.class, method="insertSelective")
    int insertSelective(PaymentDesc record);

    @SelectProvider(type=PaymentDescSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="payment_desc_content", property="paymentDescContent", jdbcType=JdbcType.VARCHAR),
        @Result(column="payment_id", property="paymentId", jdbcType=JdbcType.INTEGER)
    })
    List<PaymentDesc> selectByExample(PaymentDescExample example);

    @Select({
        "select",
        "id, payment_desc_content, payment_id",
        "from ft_payment_desc",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="payment_desc_content", property="paymentDescContent", jdbcType=JdbcType.VARCHAR),
        @Result(column="payment_id", property="paymentId", jdbcType=JdbcType.INTEGER)
    })
    PaymentDesc selectByPrimaryKey(Integer id);

    @UpdateProvider(type=PaymentDescSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") PaymentDesc record, @Param("example") PaymentDescExample example);

    @UpdateProvider(type=PaymentDescSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") PaymentDesc record, @Param("example") PaymentDescExample example);

    @UpdateProvider(type=PaymentDescSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(PaymentDesc record);

    @Update({
        "update ft_payment_desc",
        "set payment_desc_content = #{paymentDescContent,jdbcType=VARCHAR},",
          "payment_id = #{paymentId,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(PaymentDesc record);
}